﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="professionacodelist.aspx.cs" MasterPageFile="~/Site.master" Inherits="codelist" %>

    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <div style="width: 569px;" class="liststly" >
    <asp:Label runat=server BackColor="Aqua" Font-Bold="True" Height="25px" 
            style="margin-top: 0px; text-align:center" Width="567px">职位编码管理</asp:Label>
    <asp:GridView ID="gv_professiona" runat="server" AutoGenerateColumns="False" CellPadding="4"

                        ForeColor="#333333" 
            OnRowDeleting="gv_professiona_RowDeleting" DataKeyNames="iprofessiona_ID" 
            DataSourceID="SqlDataSource1"  ShowFooter ="True" GridLines="None" 
            >

                        <EditRowStyle BackColor="#2461BF" />

                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />

                        <AlternatingRowStyle BackColor="White" />

                        <Columns>

                            

                            <asp:TemplateField HeaderText="职位编码">
                              <ItemTemplate>
                                <asp:Label ID="professionaid"  runat="server" Text='<%# Bind("iprofessiona_ID") %>'></asp:Label>
                              </ItemTemplate>
 <%--                              <FooterTemplate>
                                <asp:TextBox ID="tx_professionaid" runat="server" Width="190px"></asp:TextBox>
                               </FooterTemplate>--%>
                               <ItemStyle HorizontalAlign="Center" Width="200px" />
                          </asp:TemplateField>
                            <asp:TemplateField HeaderText="职位">
                              <ItemTemplate>
                                <asp:Label ID="professionaname" runat="server" Text='<%# Bind("sprofessionaName") %>'></asp:Label>
                              </ItemTemplate>
<%--                               <FooterTemplate>
                                <asp:TextBox ID="tx_professionaname" runat="server" Width="290px"></asp:TextBox>
                               </FooterTemplate>--%>
                               <ItemStyle HorizontalAlign="Center" Width="300px" />
                      </asp:TemplateField>

                       <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                             <asp:Button ID="Button4" runat="server" CausesValidation="False" 
                                  CommandName="Delete" OnClientClick="return confirm('确认要删除吗?');" Text="删除" CssClass="CMD_3" />
                          </ItemTemplate>
<%--                             <FooterTemplate>
                               <asp:Button ID="btnprofessionaAdd" Runat="server" Text="添加"  /> 
                           </FooterTemplate>--%>
                           
                      </asp:TemplateField>

                        </Columns>

                        <RowStyle BackColor="#EFF3FB" />

                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />

                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />

                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />

                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />

                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DevMgmntConnectionString %>" 
            SelectCommand="SELECT * FROM [t_professiona]" 
            DeleteCommand="DELETE FROM [t_professiona] WHERE [iprofessiona_ID] = @iprofessiona_ID" 
            InsertCommand="INSERT INTO [t_professiona] ([iprofessiona_ID], [sprofessionaName]) VALUES (@iprofessiona_ID, @sprofessionaName)" 
            UpdateCommand="UPDATE [t_professiona] SET [sprofessionaName] = @sprofessionaName WHERE [iprofessiona_ID] = @iprofessiona_ID">
                        <DeleteParameters>
                            <asp:Parameter Name="iprofessiona_ID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="iprofessiona_ID" Type="Int32" />
                            <asp:Parameter Name="sprofessionaName" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="sprofessionaName" Type="String" />
                            <asp:Parameter Name="iprofessiona_ID" Type="Int32" />
                        </UpdateParameters>
        </asp:SqlDataSource>

        <asp:Panel ID="Panel1" runat="server">
            <asp:Label ID="Label1" runat="server" Text="编码："></asp:Label>
            <asp:TextBox ID="tx_professionaID" runat="server"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label2" runat="server" Text="职位："></asp:Label>
            <asp:TextBox ID="tx_professionaName" runat="server"></asp:TextBox>
             &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="bt_professionaAdd" runat="server" onclick="bt_professionaAdd_Click" 
                Text="添加"  />
        </asp:Panel>
                    
    </div>
    </asp:Content>
 
